<template>
  <div class="lockScrren-container" :style="{height:height}">
    <el-carousel indicator-position="outside" height="100vh" :autoplay="true">
      <el-carousel-item v-for="item in images" :key="item">
        <img :src="item" style="width:100%;height:100%">
      </el-carousel-item>
    </el-carousel>
    <div ref="lockScrrenContent" class="lockScrren-content">
      <div class="logo">
        <img src="@/assets/images/logo.png">
      </div>
      <div class="time">{{ time }}</div>
      <div class="date">{{ date }}</div>
      <div class="userInfo">
        <img :src="global.getFileView(userInfo.avatar)" size="small" :title="userInfo.realName" @error="handleImageError">
        <div class="realName">{{ userInfo.realName }}</div>
      </div>

      <el-form :inline="true" :model="lockForm" class="lock-form">
        <el-form-item>
          <el-input v-model="lockForm.password" type="password" placeholder="请输入密码" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handlerDeblocking"><i class="el-icon-right" /></el-button>
        </el-form-item>
      </el-form>
      <div class="subLogo">
        <img :src="require('@/assets/images/sub_logo.png')">
      </div>
    </div>
  </div>
</template>

<script>

export default {
  props: {
    date: {
      type: String,
      default: '-'
    },
    time: {
      type: String,
      default: '-'
    }
  },
  data() {
    return {
      images: ['../../../images/banner2.png'],
      height: `0px`,
      lockForm: {},
      fullscreen: false
    }
  },
  computed: {
  },
  created() {
  },
  mounted() {
    this.height = this.$refs.lockScrrenContent.offsetHeight + 'px'
  },
  methods: {

    handlerDeblocking() {
      if (!this.lockForm.password) {
        this.msgWarning('请输入密码!')
        return
      }
      this.$emit('unlock', this.lockForm.password)
    }
  }
}
</script>

<style lang="scss" scoped>
.lockScrren-container{
    .lock-form{
        margin-top: 120px;
    }
    .subLogo{
      margin-top: 30px;
    }
}
</style>
